<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
  
  <head>
    <meta charset="UTF-8">
    <title>订单与用户信息管理系统</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
<!--    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />-->
    <link rel="stylesheet" href="/css/font.css">
    <link rel="stylesheet" href="/css/xadmin.css">
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script th:src="@{/lib/layui/layui.js}" charset="utf-8"></script>
    <script type="text/javascript" th:src="@{/js/xadmin.js}"></script>
  </head>
  
  <body>
    <div class="x-body">
      <div class="layui-row">

<!---------------------------------------------------    新增    --------------------------------------------->
      <div class="modal" id="add">
        <div class="add_box">
        <form class="layui-form" action="/stu/admin-save" method="post">
          <div class="layui-form-item">
            <label  class="layui-form-label">
              <span class="x-red">*</span>手机
            </label>
            <div class="layui-input-inline">
              <input type="text" name="phone" class="layui-input">
            </div>
            <div class="layui-form-mid layui-word-aux">
              <span class="x-red">*</span>将会成为您唯一的登入名
            </div>
          </div>

          <div class="layui-form-item">
            <label  class="layui-form-label">
              <span class="x-red">*</span>登录名
            </label>
            <div class="layui-input-inline">
              <input type="text" name="name" class="layui-input">
            </div>
          </div>

          <div class="layui-form-item">
            <label class="layui-form-label">
              <span class="x-red">*</span>邮箱
            </label>
            <div class="layui-input-inline">
              <input type="text"  name="email"  class="layui-input">
            </div>
            <div class="layui-form-mid layui-word-aux">
              <span class="x-red">*</span>
            </div>
          </div>

          <div class="layui-form-item">
            <label class="layui-form-label">
              <span class="x-red">*</span>密码
            </label>
            <div class="layui-input-inline">
              <input type="text" name="password" class="layui-input">
            </div>
            <div class="layui-form-mid layui-word-aux">
              6到16个字符
            </div>
          </div>
          <div class="layui-form-item">
            <label  class="layui-form-label">
            </label>
            <button  class="layui-btn" lay-filter="add" lay-submit="">
              增加
            </button>
            <a class="layui-btn " href="javascript:location.replace(location.href);">
              返回
            </a>
          </div>
        </form>
        </div>
      </div>
      </div>

<!-------------------------------------------------所有信息------------------------------------------------->

      <xblock id="xbox">
        <button class="layui-btn" onclick="add()"><i class="layui-icon"></i>添加</button>
        <span class="x-right" style="line-height:40px">共有数据：<span th:text="${adminsize}"></span> 条</span>
      </xblock>
      <table class="layui-table">
        <thead>
          <tr>
            <th>登录名</th>
            <th>手机</th>
            <th>邮箱</th>
            <th>加入时间</th>
            <th>操作</th>
        </thead>
        <tbody>
          <tr th:each="admin :${adminlist}">
            <td>[[${admin.name}]]</td>
            <td>[[${admin.phone}]]</td>
            <td>[[${admin.email}]]</td>
            <td>[[${admin.creatTime}]]</td>
            <td>
              <a title="编辑"  th:href="'/stu/admin-update/'+${admin.phone}+'/'+${admin.name}+'/'+${admin.email}+'/'+${admin.password}" href="javascript:;">
                <i class="layui-icon">&#xe642;</i>
              </a>
              <a title="删除" th:href="'/stu/admin-delect/'+${admin.phone}" >
                <i class="layui-icon">&#xe640;</i>
              </a>
            </td>
          </tr>
        </tbody>
      </table>
    </div>

    <script th:inline="javascript">
      <!--增加-->
      function add(){
        $("#add").show();
      }

      <!--修改-->
      function edit(){
        $("#edit").show();
        $("#xbox").hide();
      }
    </script>
  </body>

</html>